home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 04 - 1988 / 04.10 Oct 88 / MSSourcesLong / MSParsePROC.C < prev    next >
Encoding:
Text File  |  1988-01-20  |  1.1 KB  |  55 lines  |  [TEXT/EDIT]

  1. #Options +B +E -G -H +J +K +Z
  2. #asm
  3. .verbose
  4. #endasm
  5. #include "MyTools.p"
  6. #include "MS.h"
  7. //============================
  8. MSParsePROC(theMSP,flg,resTab)
  9.     MSPtr                theMSP;
  10.     short                flg,*resTab;
  11. //=========================
  12. BEGIN_FCT
  13.     int                i;
  14.     short            allocCount,byteOffSet,
  15.                     *paramPtr,paramCtr,upper,lower;
  16.  
  17.     if (NOT BitTst(theMSP->MVT, _MFPRCPAR))
  18.         return(FALSE);
  19.     allocCount=theMSP->allocCount;
  20.     byteOffSet=_MSFIXLEN+(allocCount+1)*sizeof(MenuVerb);
  21.     paramPtr=(short *)((char *)theMSP+byteOffSet);
  22.     paramCtr=*paramPtr;
  23.     if (paramCtr LT (2*(flg+1)))
  24.         return(FALSE);
  25.     paramPtr+=2*flg+1;
  26.     FOR (i=0;i LE 1;i++)
  27.         paramPtr+=i;
  28.         upper=*paramPtr BAND 0xFF00;
  29.         lower=*paramPtr BAND 0x00FF;
  30.         
  31.         IF (upper)
  32.         THEN
  33.             if (BitTst(&lower,16))
  34.                 lower = lower BOR 0xFF00;
  35.             SWIT (upper)
  36.                 CASE (_MSMIVTST)
  37.                     *(resTab+i)=(theMSP->staticCount)+lower;
  38.                 ENDCASE
  39.                 
  40.                 CASE (_MSMIVTAL)
  41.                     *(resTab+i)=allocCount+lower;
  42.                 ENDCASE
  43.                 CASE (_MSMIVTDY)
  44.                 DEFCASE
  45.                     *(resTab+i)=CountMItems(theMSP->MH)+lower;
  46.                 ENDCASE
  47.             ENDSWIT    
  48.         ELSE
  49.             *(resTab+i)=lower;
  50.         ENDIF
  51.     ENDFOR
  52.     return (TRUE);
  53.     
  54. END_FCT
  55.